package com.captjack.validator;

import java.io.Serializable;

/**
 * Description description.....
 *
 * @author Jack Sparrow
 * @version 1.0.0
 * @date 2018/5/27 10:55
 * package com.captjack.wechat.validator.entity
 */
public class Result implements Serializable {

    private String msg;

    private int code;

    private Object data;

    public Result() {

    }

    public Result(int code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public Result(int code, String msg, Object data) {
        this.code = code;
        this.msg = msg;
        this.data = data;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public Object getData() {
        return data;
    }

    public void setData(Object data) {
        this.data = data;
    }

    // 按照模块定义Result
    // 通用异常
    public static final Result SUCCESS = new Result(0, "success");
    public static final Result SERVER_EXCEPTION = new Result(500100, "服务端异常");
    public static final Result PARAMETER_ISNULL = new Result(500101, "输入参数为空");

    // 业务异常
    public static final Result USER_NOT_EXSIST = new Result(500102, "用户不存在");
    public static final Result ONLINE_USER_OVER = new Result(500103, "在线用户数超出允许登录的最大用户限制。");
    public static final Result SESSION_NOT_EXSIST = new Result(500104, "不存在离线session数据");
    public static final Result NOT_FIND_DATA = new Result(500105, "查找不到对应数据");

}